package com.cw.jeeyt.service.utils;

import java.util.LinkedList;

/**
 * 队列工具类
 *
 * @author weihual
 */
public class QueueTool {

    private LinkedList<Object> data = new LinkedList<Object>();

    public QueueTool() {

    }

    /**
     * 入队
     *
     * @param obj
     */
    public void add(Object obj) {
        this.data.addLast(obj);
    }

    /**
     * 判断是否为空
     *
     * @return
     */
    public boolean isEmpty() {
        return data.isEmpty();
    }

    /**
     * 出队
     *
     * @return
     */
    public Object pop() {
        if (data.isEmpty()) {
            return null;
        }
        return data.removeFirst();
    }
}